# -*- coding: utf-8 -*-
"""
 @Time    : 2021/1/18 下午5:49
 @Author  : tgy
 怎样找出一个序列中出现次数最多的元素呢?

    +/-
"""
from collections import Counter


def test01():
    ...
    words = [
        'look', 'into', 'my', 'eyes', 'look', 'into', 'my', 'eyes',
        'the', 'eyes', 'the', 'eyes', 'the', 'eyes', 'not', 'around', 'the',
        'eyes', "don't", 'look', 'around', 'the', 'eyes', 'look', 'into',
        'my', 'eyes', "you're", 'under'
    ]
    counter = Counter(words)
    print(counter.most_common(3))
    # print(counter)
    for key in counter:
        print(f'{key}:{counter[key]}')


def test02():
    ...
    words = [
        'look', 'into', 'my', 'eyes', 'look', 'into', 'my', 'eyes',
        'the', 'eyes', 'the', 'eyes', 'the', 'eyes', 'not', 'around', 'the',
        'eyes', "don't", 'look', 'around', 'the', 'eyes', 'look', 'into',
        'my', 'eyes', "you're", 'under'
    ]
    others = ['the', 'eyes', 'the', 'eyes', 'the', 'eyes', 'not', 'around', 'the']
    c1 = Counter(words)
    c2 = Counter(others)
    print(c1, c2)
    print(c1 - c2)
    print(c1 + c2)


if __name__ == '__main__':
    ...
    test02()
